
import type UpdateCustomer_Dto from "@/Dto/Request/customer/updateCus_Dto";
import type UpdateCustomer from "@/Dto/Request/customer/updateCus_Dto";
import type { Response_Dto } from "@/Dto/Response/Api_Result";

import request from '@/utils/request'

/**
 * 获取客户列表
 * @param obj 
 * @returns 
 */
export const GetAllCustomer=(obj:{page:number,limit:number,key:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/customer/GetAllCustomers',
        method:'get',
        params:obj
    })
}



/**
 * 获取单个客户的跟进记录
 * @param obj 
 * @returns 
 */
export const Get_Customer_Records = (obj: { id: string }):
    Promise<Response_Dto> => {
    return request({
        url: "api/customer/GetCustomerRecordsById",
        method: "get",
        params: obj
    });
}
/**
 *新增客户跟进记录
 */
 export const add_record = (obj: any):
 Promise<Response_Dto> => {
 return request({
     url: "api/customer/AddCustomerRecord",
     method: "post",
     data: obj
 });
}

/**
 *新增客户 
 */
 export const add_customer = (obj: any):
 Promise<Response_Dto> => {
 return request({
     url: "api/customer/AddCustomer",
     method: "post",
     data: obj
 });
}

/**
 *新增转换会员
 */
 export const add_vip = (obj:{id:string}):
 Promise<Response_Dto> => {
 return request({
     url: "api/customer/Addvip",
     method: "post",
     data: obj
 });
}
/**
 * 获取员工
 * @param obj 
 * @returns 
 */
export const GetAllUsers=(obj:{key:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/customer/GetAllUsers',
        method:'get',
        params:obj
    })
}
/**
 * 获取客户详情
 * @returns 
 */
export const GetCustomerById=(obj:{id:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/customer/GetCustomerById',
        method:'get',
        params:obj
    })
}
/**
 * 修改客户信息
 * @param obj 
 * @returns 
 */
export const UpdateCustomer=(obj:UpdateCustomer_Dto):Promise<Response_Dto>=>{
    return request({
        url:'api/customer/UpdateCustomer',
        method:'post',
        data:obj
    })
}


 